#include <QApplication>
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickItem>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QQuickView view;
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.setSource(QUrl("qrc:/qml/colorpicker.qml"));
    view.show();

    QObject *item = view.rootObject()->findChild<QObject*>("myRect");
    if (item) {
        item->setProperty("color", QColor(Qt::yellow));
    }

    return a.exec();
}
